package LinkedList;

import java.util.LinkedList;

public class Main {//栈一般用ArrayDeque or Linkedlist
    public  static  void main(String[] args){//性能情况下一般不用vector及其子类stack
        LinkedList<Integer> stack = new LinkedList<Integer>();
        stack.addLast(1);
        stack.addLast(2);
        stack.addLast(3);
        stack.addLast(4);
        stack.addLast(5);
        stack.removeFirst();
        stack.removeLast();
        for (int x:stack){
            System.out.print(x+" ");
        }
    }
}
